<#import "/spring.ftl" as spring />
<html>
<head>
	<title>inspection</title>
</head>
<body>

<#include "../inspectionDropDownValues.ftl" />


<div id="content">

	<span class="error">${RequestParameters.message!}</span>

	<h1>INSPECTION DETAILS</h1>
	
	<p>
	<a href="editInspection.html?id=${inspection.id}" class="formLink">- EDIT INSPECTION -</a>&nbsp;&nbsp;
	<a href="blank/printInspection.html?id=${inspection.id}" class="formLink" target="_blank">- PRINT REPORT -</a>
	
	<#if inspection.property.location?? && inspection.property.location.street1??>
		<a href="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=${inspection.property.location.street1}<#if inspection.property.location.city??>+${inspection.property.location.city}</#if><#if inspection.property.location.state??>+${inspection.property.location.state}</#if><#if inspection.property.location.zipCode??>+${inspection.property.location.zipCode}</#if>" target="_blank" class="formLink">
			- VIEW MAP -
		</a>
	</#if>
	
	</p>

	<div class="databoxWrapper">
		<div class="databox">
			<h1>PRICE AND TIME</h1>
			<table class="databoxLabelTable2Cols">
			<tr>
				<th>INSPECTOR</th>
				<td>${inspection.inspector.name}</td>
			</tr>
			<tr>
				<th>SCHEDULED INSPECTION</th>
				<td>${inspection.inspectionTime?string("MMM dd, yyyy h:mm a")}</td>
			</tr>
			<tr>
				<th>CALCULATED INSPECTION FEE</th>
				<td>${inspection.inspectionFee?string.currency}</td>
			</tr>
			<#if (inspection.enteredInspectionFee > 0) >			
				<tr>
					<th>ENTERED INSPECTION FEE (including additional services)</th>
					<td>${inspection.enteredInspectionFee?string.currency}</td>
				</tr>
			</#if>
			<tr>
				<th>INSPECTION STATUS</th>
				<td>${inspection.inspectionStatus}</td>
			</tr>
			<tr>
				<th>PAYMENT STATUS</th>
				<td>${inspection.paymentStatus!"UNKNOWN"}
				<#if payment??>
					<a href="viewPayment.html?id=${payment.id}">payment details</a>
				</#if> 
				</td>
			</tr>
			</table>
		</div>
	</div>
	
	<div class="databoxWrapper">
		<div class="databox">
			<h1>CUSTOMER INFORMATION</h1>
			<table class="databoxLabelTable4Cols">
			<tr>
				<th>FIRST NAME</th>
				<td class="middle">${inspection.homeBuyer.name.first}</td>
				<th>LAST NAME</th>
				<td>${inspection.homeBuyer.name.last}</td>
			</tr>
			<tr>
				<th>EMAIL</th>
				<td class="middle">${inspection.homeBuyer.email}</td>
				<th>CONTACT TELEPHONE</th>
				<td>${(inspection.homeBuyer.phone)!}</td>
			</tr>
			<tr>
				<th>ADDITIONAL TELEPHONE</th>
				<td class="middle">${(inspection.homeBuyer.secondaryPhone)!}</td>
				<th>FAX</th>
				<td class="middle">${(inspection.homeBuyer.fax)!}</td>
			</tr>
			<tr>
				<th>HOME ADDRESS</th>
				<td class="middle">${(inspection.homeBuyer.address.street1)!}</td>
				<th>CITY</th>
				<td>${(inspection.homeBuyer.address.city)!}</td>
			</tr>
			<tr>
				<th>STATE</th>
				<td class="middle">${(inspection.homeBuyer.address.state.longName)!}</td>
				<th>ZIP</th>
				<td>${(inspection.homeBuyer.address.zipCode)!}</td>
			</tr>
			</table>
		</div>
	</div>	
	
	<div class="databoxWrapper">
		<div class="databox">
			<h1>SECOND CUSTOMER INFORMATION</h1>
			<table class="databoxLabelTable4Cols">
			<tr>
				<th>FIRST NAME</th>
				<td class="middle">${(inspection.secondHomeBuyer.name.first)!}</td>
				<th>LAST NAME</th>
				<td>${(inspection.secondHomeBuyer.name.last)!}</td>
			</tr>
			<tr>
				<th>EMAIL</th>
				<td class="middle">${(inspection.secondHomeBuyer.email)!}</td>
				<th>CONTACT TELEPHONE</th>
				<td>${(inspection.secondHomeBuyer.phone)!}</td>
			</tr>
			</table>
		</div>
	</div>	

	<div class="databoxWrapper">
		<div class="databox">
			<h1>PHYSICAL PROPERTY INFORMATION</h1>
			<table class="databoxLabelTable4Cols">
			<tr>
				<th>ADDRESS</th>
				<td class="middle">${(inspection.property.location.street1)!}</td>
				<th>CITY</th>
				<td>${(inspection.property.location.city)!}</td>
			</tr>
			<tr>
				<th>STATE</th>
				<td class="middle">${(inspection.property.location.state.longName)!}</td>
				<th>ZIP</th>
				<td class="middle">${(inspection.property.location.zipCode)!}</td>
			</tr>
			<tr>
				<th>CROSS STREET</th>
				<td class="middle">${(inspection.property.crossStreet)!}</td>
				<th>SUBDIVISION NAME</th>
				<td>${(inspection.property.subdivisionName)!}</td>
			</tr>
			<tr>
				<th>STATUS</th>
				<td class="middle">${occ[inspection.property.occupied?string]}</td>
				<th></th>
				<td></td>	
			</tr>
			<tr>
				<th>LOCKBOX TYPE</th>
				<td class="middle">${(inspection.lockboxType)!}</td>
				<th>LOCKBOX REALTOR CODE</th>
				<td>${(inspection.lockboxRealtorCode)!}</td>	
			</tr>
			<tr>
				<th>DWELLING TYPE</th>
				<td class="middle">${(inspection.property.propertyType)!}</td>
				<th>WHO WILL BE PRESENT DURING INSPECTION?</th>
				<td>${(inspection.presentAtInspection)!}</td>	
			</tr>
			<tr>
				<th>WILL THE ELECTICITY BE ON?</th>
				<td class="middle">${inspection.electricityExpectedToBeOn?string("yes", "no")}</td>	
				<th>WILL THE GAS BE ON?</th>
				<td class="middle">${inspection.gasExpectedToBeOn?string("yes", "no")}</td>	
			</tr>
			<tr>
				<th>WILL THE WATER BE ON?</th>
				<td class="middle">${inspection.waterExpectedToBeOn?string("yes", "no")}</td>	
				<th>TYPE OF FOUNDATION</th>
				<td class="middle">${(inspection.property.foundationType)!}</td>
			</tr>
			<tr>
				<th>NUMBER OF STORIES</th>
				<td>${inspection.property.numberOfStories}</td>
				<th>OTHER STRUCTURES (detached garage, etc)</th>
				<td class="middle">${(inspection.property.otherStructures)!}</td>
			</tr>
			<tr>
				
				<th>YEAR OF CONSTRUCTION</th>
				<#if (inspection.property.constructionYear == 0) >
					<td>n/a</td>
				<#else>
					<td>${inspection.property.constructionYear?string("####")} (${inspection.property.ageInYears?string("####")} years)</td>
				</#if>
				<th></th>
				<td></td>
			</tr>
			</table>
		</div>
	</div>
	
	<div class="databoxWrapper">
		<div class="databox">
			<h1>PROPERTY LISTING INFORMATION</h1>
			<table class="databoxLabelTable4Cols">
			<tr>
				<th>PRICE</th>
				<td class="middle">${(inspection.property.listedPrice?string.currency)!}</td>
				<th>NUMBER OF AC UNITS</th>
				<#if inspection.property.numberOfAcUnits==-1>
					<td>Don't know</td>
				<#else>
					<td>${inspection.property.numberOfAcUnits}</td>
				</#if>
			</tr>
			<tr>
				<th>NUMBER OF BEDROOMS</th>
				<td class="middle">${(inspection.property.numberOfBedrooms)!}</td>
				<th>NUMBER OF BATHROOMS</th>
				<td>${inspection.property.numberOfBathrooms}</td>
			</tr>
			</table>
		</div>
	</div>
	
	<div class="databoxWrapper">
		<div class="databox">
			<h1>LISTING AGENT INFORMATION</h1>
			<table class="databoxLabelTable4Cols">
			<tr>
				<th>AGENT NAME</th>
				<td class="middle">${(inspection.listingAgentName)!}</td>
				<th>AGENT PHONE NUMBER</th>
				<td>${(inspection.listingAgentPhoneNumber)!}</td>
			</tr>
			</table>
		</div>
	</div>
	
	<div class="databoxWrapper">
		<div class="databox">
			<h1>ADDITIONAL SERVICES</h1>
			<#if inspection.optionalServices?? && (inspection.optionalServices?size > 0)>
				<table class="databoxLabelTable">
				<#list inspection.optionalServices as optionalService>
					<tr>
						<td>${optionalService.title} (${optionalService.price?string.currency})</td>
					</tr>
				</#list>
				</table>
			<#else>
				<p class="databoxFreeForm">
					No Additional Services were selected.
				</p>
			</#if>
		</div>
	</div>
	
	<div class="databoxWrapper">
		<div class="databox">
			<h1>REFERRING REAL ESTATE AGENT INFORMATION</h1>
			<table class="databoxLabelTable2Cols"
			<tr>
				<th>FIRST NAME</th>
				<td>${(inspection.referringAgent.name.first)!}</td>
			</tr>
			<tr>
				<th>LAST NAME</th>
				<td>${(inspection.referringAgent.name.last)!}</td>
			</tr>
			<tr>
				<th>COMPANY</th>
				<td>${(inspection.referringAgent.company)!}</td>
			</tr>
			
			<tr>
				<th>OFFICE</th>
				<td>${(inspection.referringAgent.office)!}</td>
			</tr>
			<tr>
				<th>PHONE</th>
				<td>${(inspection.referringAgent.cellPhone)!}</td>
			</tr>
			<tr>
				<th>EMAIL ADDRESS</th>
				<td>${(inspection.referringAgent.email)!}</td>
			</tr>
			</table>
		</div>
	</div>
	
	<p>* Do you wish to send your referring realtor a copy of the property inspection report?</p>
	<#--@spring.formInput "inspection.sellingAgentMakeReportAvailable", 'size="30"'/-->
	
	<div class="databoxWrapper">
		<div class="databox">
			<h1>SPECIAL INSTRUCTIONS</h1>
			<table class="databoxLabelTable2Cols">
			<tr>
				<th>COMMENTS</th>
				<td>${inspection.comments!}</td>
			</tr>
			</table>
		</div>
	</div>
</div>
	
</body>
</html>
